package org.fuys.coder.domain.auth.service.common.login.config;

import org.fuys.coder.domain.auth.service.handler.login.LoginHandlerChain;
import org.fuys.coder.domain.auth.service.handler.login.impl.FreezeCheckHandler;
import org.fuys.coder.domain.auth.service.handler.login.impl.InfoGetHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.common.config.beans
 * @className: LoginHandlerConfig
 * @author: WangJing
 * @description: 登录处理器链路配置
 * @date: 2024/8/9 18:03
 * @version: 1.0
 */

@Configuration
public class LoginHandlerConfig {

    @Resource
    private FreezeCheckHandler freezeCheckHandler;

    @Resource
    private InfoGetHandler infoGetHandler;

    @Bean
    public LoginHandlerChain loginHandlerChain(){
        LoginHandlerChain loginHandlerChain=new LoginHandlerChain();
        loginHandlerChain.addHandler(freezeCheckHandler);
        loginHandlerChain.addHandler(infoGetHandler);
        return loginHandlerChain;
    }
}
